package com.iplant.wms.service.po.wpo;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;
import java.util.Calendar;

/**
 * 采购订单明细
 *
 * @author YouWang·Peng
 * @CreateTime 2022-4-2 22:04:25
 */

@DBBasePO(TableName = "wms_purchaseorderitem", CheckName = {"Code"}, Name = false, Active = false,
        Schemas = DBSchemas.WMS, CodeAuto = true, CodePrefix = "POI{yyMM}", CodeNum = 6)
public class WMSPurchaseOrderItem extends BasePO implements Serializable {

    /**
     * 序列化
     */
    private static final long serialVersionUID = 1L;


    @DBCondition
    @DBField
    public int FactoryID = 0;

    @DBJoin(name = "Code", tableName = "fmc_factory", tableAsName = "f1",
            Schemas = DBSchemas.Basic, MainTableField = "FactoryID")
    public String FactoryCode = "";

    @DBJoin(name = "Name", tableName = "fmc_factory", tableAsName = "f1",
            Schemas = DBSchemas.Basic, MainTableField = "FactoryID")
    public String FactoryName = "";

    /**
     * 采购订单ID   Name 可用作行号 Active 是状态
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.in)
    @DBField
    public int PurchaseOrderID = 0;

    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "PurchaseOrderCodeEQ")
    @DBJoin(name = "Code", tableName = "wms_purchaseorder", tableAsName = "po1",
            Schemas = DBSchemas.Basic, MainTableField = "PurchaseOrderID")
    public String PurchaseOrderCode = "";

    /**
     * 采购订单状态
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.in)
    @DBJoin(name = "Status", tableName = "wms_purchaseorder", tableAsName = "po1",
            Schemas = DBSchemas.Basic, MainTableField = "PurchaseOrderID")
    public int OrderStatus = 0;


    /**
     * 货主 就是客户
     */
    @DBCondition
    @DBField
    public int CustomerID = 0;

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "crm_customer", tableAsName = "c1",
            Schemas = DBSchemas.Basic, MainTableField = "CustomerID")
    public String CustomerCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "crm_customer", tableAsName = "c1",
            Schemas = DBSchemas.Basic, MainTableField = "CustomerID")
    public String CustomerName = "";


    /**
     * 供应商
     */
    @DBCondition
    @DBField
    public int SupplierID = 0;
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "crm_customer", tableAsName = "c2",
            Schemas = DBSchemas.Basic, MainTableField = "SupplierID")
    public String SupplierCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "crm_customer", tableAsName = "c2",
            Schemas = DBSchemas.Basic, MainTableField = "SupplierID")
    public String SupplierName = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "ProjectNoEQ")
    @DBField
    public String ProjectNo = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like, ParamName2 = "ProjectNameEQ")
    @DBField
    public String ProjectName = "";
    /**
     * 仓库ID  可能与订单的仓库ID不同
     */
    @DBCondition
    @DBField
    public int StoreID = 0;

    @DBJoin(name = "Name", tableName = "wms_store", tableAsName = "st4",
            JoinMode = DBJoin.DBJoinMode.Left,
            Schemas = DBSchemas.WMS, MainTableField = "StoreID")
    public String StoreName = "";
    @DBJoin(name = "Code", tableName = "wms_store", tableAsName = "st4",
            JoinMode = DBJoin.DBJoinMode.Left,
            Schemas = DBSchemas.WMS, MainTableField = "StoreID")
    public String StoreCode = "";

    @DBCondition
    @DBField(CheckValue = true)
    public int MaterialID = 0;

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Code", tableName = "mss_material", tableAsName = "m2", JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.Basic, MainTableField = "MaterialID")
    public String MaterialCode = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBJoin(name = "Name", tableName = "mss_material", tableAsName = "m2", JoinMode = DBJoin.DBJoinMode.Inner,
            Schemas = DBSchemas.Basic, MainTableField = "MaterialID")
    public String MaterialName = "";

    @DBCondition
    @DBField
    public int PackageRuleID = 0;

    /**
     * 包装规则
     */
    @DBJoin(name = "Code", tableName = "mss_packagerule", tableAsName = "pr1", JoinMode = DBJoin.DBJoinMode.Left,
            Schemas = DBSchemas.WMS, MainTableField = "PackageRuleID")
    public String PackageRuleCode = "";

    @DBJoin(name = "Name", tableName = "mss_packagerule", tableAsName = "pr1", JoinMode = DBJoin.DBJoinMode.Left,
            Schemas = DBSchemas.WMS, MainTableField = "PackageRuleID")
    public String PackageRuleName = "";
    /**
     * 物料数量   物料数量
     */
    @DBField
    public double MaterialNumber = 0.0;

    /**
     * 已收数量  物料数量
     */
    @DBField
    public double ReceivedMaterialNumber = 0.0;


    @DBField
    public Calendar ReceivedTime = Calendar.getInstance();


    /**
     * 收货单位
     */
    @DBField
    public int ReceiveUnit = 0;

    /**
     * 辅计量单位
     */
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "unt1", Schemas = DBSchemas.Basic,
            MainTableField = "ReceiveUnit")
    public String ReceiveUnitText = "";

    /**
     * 体积
     */
    @DBField
    public int TotalVolume = 0;

    @DBField
    public int TotalGrossWeight = 0;

    @DBField
    public int TotalNetWeight = 0;

    @DBField
    public double TotalPrice = 0.0;
    @DBField
    public String UserDefine1 = "";
    @DBField
    public String UserDefine2 = "";
    @DBField
    public String UserDefine3 = "";


    @JsonProperty("PurchaseOrderID")
    public int getPurchaseOrderID() {
        return PurchaseOrderID;
    }

    public void setPurchaseOrderID(int purchaseOrderID) {
        PurchaseOrderID = purchaseOrderID;
    }

    @JsonProperty("PurchaseOrderCode")
    public String getPurchaseOrderCode() {
        return PurchaseOrderCode;
    }

    public void setPurchaseOrderCode(String purchaseOrderCode) {
        PurchaseOrderCode = purchaseOrderCode;
    }


    @JsonProperty("OrderStatus")
    public int getOrderStatus() {
        return OrderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        OrderStatus = orderStatus;
    }

    @JsonProperty("CustomerID")
    public int getCustomerID() {
        return CustomerID;
    }

    public void setCustomerID(int customerID) {
        CustomerID = customerID;
    }

    @JsonProperty("CustomerName")
    public String getCustomerName() {
        return CustomerName;
    }

    public void setCustomerName(String customerName) {
        CustomerName = customerName;
    }

    @JsonProperty("CustomerCode")
    public String getCustomerCode() {
        return CustomerCode;
    }

    public void setCustomerCode(String customerCode) {
        CustomerCode = customerCode;
    }

    @JsonProperty("SupplierID")
    public int getSupplierID() {
        return SupplierID;
    }

    public void setSupplierID(int supplierID) {
        SupplierID = supplierID;
    }

    @JsonProperty("SupplierCode")
    public String getSupplierCode() {
        return SupplierCode;
    }

    public void setSupplierCode(String supplierCode) {
        SupplierCode = supplierCode;
    }

    @JsonProperty("SupplierName")
    public String getSupplierName() {
        return SupplierName;
    }

    public void setSupplierName(String supplierName) {
        SupplierName = supplierName;
    }

    @JsonProperty("StoreID")
    public int getStoreID() {
        return StoreID;
    }

    public void setStoreID(int storeID) {
        StoreID = storeID;
    }

    @JsonProperty("StoreName")
    public String getStoreName() {
        return StoreName;
    }

    public void setStoreName(String storeName) {
        StoreName = storeName;
    }

    @JsonProperty("StoreCode")
    public String getStoreCode() {
        return StoreCode;
    }

    public void setStoreCode(String storeCode) {
        StoreCode = storeCode;
    }


    @JsonProperty("MaterialName")
    public String getMaterialName() {
        return MaterialName;
    }

    public void setMaterialName(String materialName) {
        MaterialName = materialName;
    }

    @JsonProperty("PackageRuleCode")
    public String getPackageRuleCode() {
        return PackageRuleCode;
    }

    public void setPackageRuleCode(String packageRuleCode) {
        PackageRuleCode = packageRuleCode;
    }

    @JsonProperty("PackageRuleName")
    public String getPackageRuleName() {
        return PackageRuleName;
    }

    public void setPackageRuleName(String packageRuleName) {
        PackageRuleName = packageRuleName;
    }

    @JsonProperty("MaterialNumber")
    public double getMaterialNumber() {
        return MaterialNumber;
    }

    public void setMaterialNumber(double materialNumber) {
        MaterialNumber = materialNumber;
    }

    @JsonProperty("ReceivedMaterialNumber")
    public double getReceivedMaterialNumber() {
        return ReceivedMaterialNumber;
    }

    public void setReceivedMaterialNumber(double receivedMaterialNumber) {
        ReceivedMaterialNumber = receivedMaterialNumber;
    }

    @JsonProperty("ReceivedTime")
    public Calendar getReceivedTime() {
        return ReceivedTime;
    }

    public void setReceivedTime(Calendar receivedTime) {
        ReceivedTime = receivedTime;
    }

    @JsonProperty("TotalVolume")
    public int getTotalVolume() {
        return TotalVolume;
    }

    public void setTotalVolume(int totalVolume) {
        TotalVolume = totalVolume;
    }

    @JsonProperty("TotalGrossWeight")
    public int getTotalGrossWeight() {
        return TotalGrossWeight;
    }

    public void setTotalGrossWeight(int totalGrossWeight) {
        TotalGrossWeight = totalGrossWeight;
    }

    @JsonProperty("TotalNetWeight")
    public int getTotalNetWeight() {
        return TotalNetWeight;
    }

    public void setTotalNetWeight(int totalNetWeight) {
        TotalNetWeight = totalNetWeight;
    }

    @JsonProperty("TotalPrice")
    public double getTotalPrice() {
        return TotalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        TotalPrice = totalPrice;
    }

    @JsonProperty("UserDefine1")
    public String getUserDefine1() {
        return UserDefine1;
    }

    public void setUserDefine1(String userDefine1) {
        UserDefine1 = userDefine1;
    }

    @JsonProperty("UserDefine2")
    public String getUserDefine2() {
        return UserDefine2;
    }

    public void setUserDefine2(String userDefine2) {
        UserDefine2 = userDefine2;
    }

    @JsonProperty("UserDefine3")
    public String getUserDefine3() {
        return UserDefine3;
    }

    public void setUserDefine3(String userDefine3) {
        UserDefine3 = userDefine3;
    }


    @JsonProperty("ProjectNo")
    public String getProjectNo() {
        return ProjectNo;
    }

    public void setProjectNo(String projectNo) {
        ProjectNo = projectNo;
    }

    @JsonProperty("ProjectName")
    public String getProjectName() {
        return ProjectName;
    }

    public void setProjectName(String projectName) {
        ProjectName = projectName;
    }

    @JsonProperty("MaterialID")
    public int getMaterialID() {
        return MaterialID;
    }

    public void setMaterialID(int materialID) {
        MaterialID = materialID;
    }


    @JsonProperty("FactoryID")
    public int getFactoryID() {
        return FactoryID;
    }

    public void setFactoryID(int factoryID) {
        FactoryID = factoryID;
    }

    @JsonProperty("FactoryCode")
    public String getFactoryCode() {
        return FactoryCode;
    }

    public void setFactoryCode(String factoryCode) {
        FactoryCode = factoryCode;
    }

    @JsonProperty("FactoryName")
    public String getFactoryName() {
        return FactoryName;
    }

    public void setFactoryName(String factoryName) {
        FactoryName = factoryName;
    }

    @JsonProperty("MaterialCode")
    public String getMaterialCode() {
        return MaterialCode;
    }

    public void setMaterialCode(String materialCode) {
        MaterialCode = materialCode;
    }

    @JsonProperty("PackageRuleID")
    public int getPackageRuleID() {
        return PackageRuleID;
    }

    public void setPackageRuleID(int packageRuleID) {
        PackageRuleID = packageRuleID;
    }

    @JsonProperty("ReceiveUnit")
    public int getReceiveUnit() {
        return ReceiveUnit;
    }

    public void setReceiveUnit(int receiveUnit) {
        ReceiveUnit = receiveUnit;
    }

    @JsonProperty("ReceiveUnitText")
    public String getReceiveUnitText() {
        return ReceiveUnitText;
    }

    public void setReceiveUnitText(String receiveUnitText) {
        ReceiveUnitText = receiveUnitText;
    }


}
